package cn.zhoumingxin.Test;

public class TestShort {
	public static void main(String[] args) {
		
		short max = (short) (Math.pow(2, 15)-1);
		System.out.println(max);
		
		//十进制转二进制
//		short r = 0;
//		while(max >= 2) {
//			r = (short) (max % 2);
//			System.out.print(r);
//			max = (short) ((max - r)/2);
//		}
//		System.out.print(max);
		
		//十进制转十六进制
		short r = 0;
		while(max >= 16) {
			r = (short) (max % 16);
			System.out.print(r);
			max = (short) ((max - r)/16);
		}
		System.out.print(max);
		
//		System.out.println(max);
	}

}
